

use strict;
use warnings;




my $accPiJiu = 0;
my $realPj = 0;
my $pinggai = 0;
my $kongping = 0;
my $totalMoney = 10;
my $remainMoney = $totalMoney;
while ($remainMoney >= 0 || $pinggai >= 4 || $kongping >= 2) {
	if($remainMoney >=0){
		$accPiJiu++;
		$pinggai++;
		$kongping++;
	}
	$realPj= $accPiJiu if($realPj < $accPiJiu);
	 $remainMoney = $totalMoney -$accPiJiu*2;
	 if($pinggai >= 4)
	 {
	 	$realPj++;
	 	$kongping++;
	 	$pinggai -= 3;
	 }
	 if($kongping >= 2)
	 {
	 	$realPj++;
	 	$kongping -= 1;
	 	$pinggai++;
	}
	print "$realPj $kongping $pinggai\n";
}
print "$realPj $kongping $pinggai\n";